package net.zjitc.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.zjitc.domain.User;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class UserServicetest {
    @Autowired
    private UserService userService;

    @Test
    void addTest() {
        User user = new User();
        user.setId(6);
        user.setUsername("lisi");
        user.setGender("女");
        user.setPassword("123");
        user.setEmail("email@email.com");
        userService.addUser(user);
    }

    @Test
    void findbyid() {
        System.out.println(userService.findById(1));
    }

    @Test
    void update() {
        User user = new User();
        user.setId(1);
        user.setUsername("lisi");
        user.setGender("女");
        user.setPassword("123111111");
        user.setEmail("email@email.com");
        userService.UpdateUser(user);
    }

    @Test
    void findPageTest() {
        User user = new User();
        user.setUsername("z");
        user.setGender("男");
        System.out.println(userService.findPage(1, 1, user));
    }
}
